package cate.game.util.ct;

public class GsCT {

    public int srvId;

    public long nMsgInput;

    public long nMsgOutput;

    public int nPlayStart;

    public int nGiftCodeUse;
    public long giftCodeUseTime;
    public long giftCodeUseMsMin = 999999;
    public long giftCodeUseMsMax = 0;


    public int nPayRefund;
    public long payRefundTime;
    public long payRefundMsMin = 999999;
    public long payRefundMsMax = 0;

    public void addGiftCodeUseTime(long costTime) {
        nGiftCodeUse++;
        giftCodeUseTime += costTime;
        giftCodeUseMsMin = Math.min(giftCodeUseMsMin, costTime);
        giftCodeUseMsMax = Math.max(giftCodeUseMsMax, costTime);
    }

    public void addPayRefundTime(long costTime) {
        nPayRefund++;
        payRefundTime += costTime;
        payRefundMsMin = Math.min(payRefundMsMin, costTime);
        payRefundMsMax = Math.max(payRefundMsMax, costTime);
    }

    public String toDetail() {
        return "nMsgInput=" + nMsgInput + " nMsgOutput=" + nMsgOutput + " nPlayStart=" + nPlayStart
                + " nGiftCodeUse=" + nGiftCodeUse + "次 giftCodeUseTime=" + (giftCodeUseTime/1000) + "秒"
                + " giftCodeUseMsMin=" + giftCodeUseMsMin + "ms giftCodeUseMsMax=" + giftCodeUseMsMax + "ms"
                + " nPayRefund=" + nPayRefund + "次 payRefundTime=" + (payRefundTime/1000) + "秒"
                + " payRefundMsMin=" + payRefundMsMin + "ms payRefundMsMax=" + payRefundMsMax + "ms";
    }
}
